package com.shop.cereshop.commons.domain.stat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 每日运营指标快照表实体类
 */
@Data
@TableName("cere_dashboard_stats")
@ApiModel(value = "CereDashboardStats", description = "每日运营指标快照表")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CereDashboardStats {

    /**
     * 统计数据主键id
     */
    @TableId(value = "stat_id", type = IdType.AUTO)
    @ApiModelProperty(value = "统计数据主键id")
    private Long statId;

    /**
     * 统计日期, 如果 2025-10-09
     */
    @TableField("stat_date")
    @ApiModelProperty(value = "统计日期, 如果 2025-10-09")
    private LocalDate statDate;

    /**
     * 省份，空字符表示全国汇总
     */
    @TableField("province")
    @ApiModelProperty(value = "省份，null表示全国汇总")
    private String province;

    /**
     * 城市，空字符表示省份汇总
     */
    @TableField("city")
    @ApiModelProperty(value = "城市，null表示省份汇总")
    @JsonProperty("city")
    private String city;

    /**
     * 新增用户数
     */
    @TableField("new_users")
    @ApiModelProperty(value = "新增用户数")
    private Integer newUsers;

    /**
     * 新增商家数
     */
    @TableField("new_shops")
    @ApiModelProperty(value = "新增商家数")
    private Integer newShops;

    /**
     * 用户消费金额
     */
    @TableField("consumption_amount")
    @ApiModelProperty(value = "用户消费金额")
    private BigDecimal consumptionAmount;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
}
